# Hard line breaks

A line break (not in a code span or HTML tag) that is preceded by two or more spaces and does not occur at the end of a block is parsed as a hard line break (opens new window) (rendered in HTML as a <br /> tag):

Example 654

Markdown HTML Demo
foo  
baz

<p>foo<br />
baz</p>

For a more visible alternative, a backslash before the line ending (opens new window) may be used instead of two spaces:

Example 655

Markdown HTML Demo
foo\
baz

<p>foo<br />
baz</p>

More than two spaces can be used:

Example 656

Markdown HTML Demo
foo       
baz

<p>foo<br />
baz</p>

Leading spaces at the beginning of the next line are ignored:

Example 657

Markdown HTML Demo
foo  
     bar

<p>foo<br />
bar</p>

Example 658

Markdown HTML Demo
foo\
     bar

<p>foo<br />
bar</p>

Line breaks can occur inside emphasis, links, and other constructs that allow inline content:

Example 659

Markdown HTML Demo
*foo  
bar*

<p><em>foo<br />
bar</em></p>

Example 660

Markdown HTML Demo
*foo\
bar*

<p><em>foo<br />
bar</em></p>

Line breaks do not occur inside code spans

Example 661

Markdown HTML Demo
`code  
span`

<p><code>code   span</code></p>

Example 662

Markdown HTML Demo
`code\
span`

<p><code>code\ span</code></p>

or HTML tags:

Example 663

Markdown HTML Demo
<a href="foo  
bar">

<p><a href="foo  
bar"></p>

Example 664

Markdown HTML Demo
<a href="foo\
bar">

<p><a href="foo\
bar"></p>

Hard line breaks are for separating inline content within a block. Neither syntax for hard line breaks works at the end of a paragraph or other block element:

Example 665

Markdown HTML Demo
foo\

<p>foo\</p>

Example 666

Markdown HTML Demo
foo  

<p>foo</p>

Example 667

Markdown HTML Demo
### foo\

<h3>foo\</h3>

Example 668

Markdown HTML Demo
### foo  

<h3>foo</h3>